package Model
{
	import com.mediatecture.flex.component.CustimXMLEncoder;
	
	import flash.xml.XMLDocument;
	import flash.xml.XMLNode;

	public class Project
	{
		private var _projectInfo:ProjectInfo;
		private var _areas:Areas;
		private var _quality:Quality;
		private var _shading:OverallShading;
		private var _heating:HeatingInfo;
		private var _language:String;
		private var _modified:Boolean = false;
		
		public function Project()
		{
			this.projectInfo = new ProjectInfo();
			this.areas = new Areas();
			this._quality = new Quality();
			this._shading = new OverallShading();
			this._heating = new HeatingInfo();
		}

		public function get shading():OverallShading
		{
			return _shading;
		}

		public function set shading(value:OverallShading):void
		{
			_shading = value;
		}

		public function get language():String
		{
			return _language;
		}

		public function set language(value:String):void
		{
			_language = value;
		}

		public function get modified():Boolean
		{
			return _modified;
		}

		public function set modified(value:Boolean):void
		{
			_modified = value;
		}

		public function get areas():Areas
		{
			return _areas;
		}

		public function set areas(value:Areas):void
		{
			_areas = value;
		}

		public function get projectInfo():ProjectInfo
		{
			return _projectInfo;
		}

		public function set projectInfo(value:ProjectInfo):void
		{
			_projectInfo = value;
		}

		public function get quality():Quality
		{
			return _quality;
		}

		public function set quality(value:Quality):void
		{
			_quality = value;
		}

		public function get heating():HeatingInfo
		{
			return _heating;
		}

		public function set heating(value:HeatingInfo):void
		{
			_heating = value;
		}
		
		public function toXML(qName:QName, destination:XMLDocument, encoder:CustimXMLEncoder):void
		{
			var xmlNode:XMLNode = encoder.encodeValue(this, qName,destination);
		}
		
		public function isModified():Boolean
		{
			if(this.projectInfo.isModified())
				return true;
			return false;
		}
	}
}